package com.tax.config.exception;
/**
 * @author 段德辉
 */
public class BaseException extends Exception {
    private static final long serialVersionUID = 1L;
    protected String errKey = "";
    protected String errMsg = "";
    protected transient Object data;

    public BaseException() {
    }

    public BaseException(String errKey, String errMsg) {
        super(errKey);
        this.errKey = errKey;
        this.errMsg = errMsg;
    }

    public BaseException(String errKey, String errMsg, Object data) {
        this.errKey = errKey;
        this.errMsg = errMsg;
        this.data = data;
    }

    public BaseException(String errKey) {
        super(errKey);
        this.errKey = errKey;
    }

    public BaseException(String errKey, Throwable throwable) {
        super(errKey, throwable);
        this.errKey = errKey;
    }

    public String setKey(String errKey) {
        return this.errKey = errKey;
    }

    public String getKey() {
        return this.errKey;
    }

    public String setMessage(String errMsg) {
        return this.errMsg = errMsg;
    }

    @Override
    public String getMessage() {
        return this.errMsg;
    }

    @Override
    public String toString() {
        return "BaseException [errKey=" + this.errKey + ", errMsg=" + this.errMsg + "]";
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}